#include<bits/stdc++.h>
using namespace std;
int a[100001],b[100001],vis[100001];
int main()
{
	int n,i,f,s1=0,s=0,t;
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	cin>>n;
	for(i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	while(true)
	{
		int f=-1,s1=0;
		memset(b,0,sizeof(b));
		for(i=1;i<=n;i++)
		{
			if(f!=a[i]&&vis[i]==0)
			{
				s1++;
				s++;
				f=a[i];
				vis[i]=1;
				printf("%d ",i);
			}
		}
		cout<<endl;
		if(s==n)break;
	}
	fclose(stdin);
	fclose(stdout);
}
